package com.sunny;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 业务异常类
 */
@Data
@NoArgsConstructor
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    
    private Integer code;
    private String message;
    
    public BusinessException(String message) {
        this(Result.ERROR_CODE, message);
    }

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    
    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.code = Result.ERROR_CODE;
        this.message = message;
    }
}